.class public Lrexsee/device/RexseeVibrate;
.super Ljava/lang/Object;
.source "RexseeVibrate.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field private static final INTERFACE_NAME:Ljava/lang/String; = "Vibrate"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private final mContext:Landroid/content/Context;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 1
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 28
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 29
    iput-object p1, p0, Lrexsee/device/RexseeVibrate;->mBrowser:Lrexsee/core/browser/Browser;

    .line 30
    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lrexsee/device/RexseeVibrate;->mContext:Landroid/content/Context;

    .line 31
    return-void
.end method


# virtual methods
.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 17
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 13
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/device/RexseeVibrate;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "Vibrate"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 21
    new-instance v0, Lrexsee/device/RexseeVibrate;

    invoke-direct {v0, p1}, Lrexsee/device/RexseeVibrate;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method

.method public vibrate()V
    .locals 2

    .prologue
    .line 35
    iget-object v0, p0, Lrexsee/device/RexseeVibrate;->mContext:Landroid/content/Context;

    const-string v1, "vibrator"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p0

    .end local p0    # "this":Lrexsee/device/RexseeVibrate;
    check-cast p0, Landroid/os/Vibrator;

    const-wide/16 v0, 0x19

    invoke-virtual {p0, v0, v1}, Landroid/os/Vibrator;->vibrate(J)V

    .line 36
    return-void
.end method

.method public vibrate(Ljava/lang/String;)V
    .locals 6
    .param p1, "pattern"    # Ljava/lang/String;

    .prologue
    const-string v5, "vibrator"

    .line 38
    const-string v3, "\\|"

    invoke-virtual {p1, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v2

    .line 39
    .local v2, "tmp":[Ljava/lang/String;
    array-length v3, v2

    const/4 v4, 0x1

    if-ne v3, v4, :cond_0

    .line 40
    iget-object v3, p0, Lrexsee/device/RexseeVibrate;->mContext:Landroid/content/Context;

    const-string v4, "vibrator"

    invoke-virtual {v3, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p0

    .end local p0    # "this":Lrexsee/device/RexseeVibrate;
    check-cast p0, Landroid/os/Vibrator;

    const/4 v3, 0x0

    aget-object v3, v2, v3

    invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v3

    int-to-long v3, v3

    invoke-virtual {p0, v3, v4}, Landroid/os/Vibrator;->vibrate(J)V

    .line 49
    :goto_0
    return-void

    .line 43
    .restart local p0    # "this":Lrexsee/device/RexseeVibrate;
    :cond_0
    array-length v3, v2

    new-array v1, v3, [J

    .line 44
    .local v1, "p":[J
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_1
    array-length v3, v1

    if-lt v0, v3, :cond_1

    .line 47
    iget-object v3, p0, Lrexsee/device/RexseeVibrate;->mContext:Landroid/content/Context;

    const-string v4, "vibrator"

    invoke-virtual {v3, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p0

    .end local p0    # "this":Lrexsee/device/RexseeVibrate;
    check-cast p0, Landroid/os/Vibrator;

    const/4 v3, -0x1

    invoke-virtual {p0, v1, v3}, Landroid/os/Vibrator;->vibrate([JI)V

    goto :goto_0

    .line 45
    .restart local p0    # "this":Lrexsee/device/RexseeVibrate;
    :cond_1
    aget-object v3, v2, v0

    invoke-static {v3}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v3

    aput-wide v3, v1, v0

    .line 44
    add-int/lit8 v0, v0, 0x1

    goto :goto_1
.end method
